﻿<UserControl x:Class="ProgrammersCalculator.View.EncryptionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:conv="clr-namespace:ProgrammersCalculator.Convertor"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="300">
    <UserControl.Resources>

        <conv:ExpanderToBooleanConverter x:Key="ExpanderToBooleanConverter"></conv:ExpanderToBooleanConverter>
        <conv:EncryptionConverter x:Key="ceaser"></conv:EncryptionConverter>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot"
          Margin="10,15,10,10">
        <DockPanel>
            <Border DockPanel.Dock="Top"
                    Style="{DynamicResource styleContentArea}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <!-- HEADER -->
                    <Border Grid.Row="0"
                            Style="{DynamicResource styleContentAreaHeader}">
                        <Grid>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock FontSize="20"
                                           Padding="8"
                                           VerticalAlignment="Center">Encryption</TextBlock>
                            </StackPanel>
                        </Grid>
                    </Border>

                    <!--CONTENT AREA-->
                    <Grid Grid.Row="1">
                        <StackPanel x:Name="ContentStackPanel"
                                    Margin="20">
                            <StackPanel Margin="0">
                                <Expander Header="Ceaser Encryption"
                                          FontFamily="Verdana"
                                          IsExpanded="{Binding SelectedExpander, Mode=TwoWay, Converter={StaticResource ExpanderToBooleanConverter}, ConverterParameter=1}">
                                    <StackPanel Margin="10,4,0,0">
                                        <TextBlock Text="Enter  String"></TextBlock>
                                        <TextBox TextWrapping="Wrap"
                                                 VerticalAlignment="Top"
                                                 VerticalScrollBarVisibility="Visible"
                                                 AcceptsReturn="True"
                                                 Height="100"
                                                 Name="txtInput" />
                                        <Border CornerRadius="10"
                                                Background="#FFF9F7F7"
                                                Height="5"></Border>
                                        <TextBlock Text="Shift"
                                                   FontFamily="Verdana"></TextBlock>
                                        <TextBox TextWrapping="Wrap"
                                                 VerticalScrollBarVisibility="Auto"
                                                 AcceptsReturn="True"
                                                 Text="{Binding ElementName=txtInput,Path=Text,Converter={StaticResource ceaser},ConverterParameter=3}"
                                                 Name="txtMd5"
                                                 CaretIndex="1"
                                                 FontFamily="Arial Unicode MS" />
                                    </StackPanel>
                                </Expander>

                                <Expander Header="Vigenere Cipher"
                                          FontFamily="Verdana"
                                          IsExpanded="{Binding SelectedExpander, Mode=TwoWay, Converter={StaticResource ExpanderToBooleanConverter}, ConverterParameter=2}">
                                    <StackPanel Margin="10,4,0,0">
                                        <TextBlock Text="Enter  String"></TextBlock>
                                        <TextBox TextWrapping="Wrap"
                                                 VerticalAlignment="Top"
                                                 VerticalScrollBarVisibility="Visible"
                                                 AcceptsReturn="True"
                                                 Height="100"
                                                 Name="txtStringSHA" />
                                        <Border CornerRadius="10"
                                                Background="#FFF9F7F7"
                                                Height="5"></Border>
                                        <TextBox TextWrapping="Wrap"
                                                 VerticalScrollBarVisibility="Auto"
                                                 AcceptsReturn="True"
                                                 Name="txtSHA1"
                                                 CaretIndex="1"
                                                 FontFamily="Arial Unicode MS" />
                                    </StackPanel>
                                </Expander>

                            </StackPanel>
                        </StackPanel>
                    </Grid>
                </Grid>
            </Border>
        </DockPanel>
    </Grid>

</UserControl>
